/*
 * Summary.java
 *
 * Created on April 12, 2006, 9:26 PM
 */

/**
 *
 * @author  Sujal Bista
 */
public class Summary extends javax.swing.JDialog {
    
    /** Creates new form Summary */
    public Summary(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
    
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        jPanel2 = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        nameL = new javax.swing.JLabel();
        mistakeL = new javax.swing.JLabel();
        eventL = new javax.swing.JLabel();
        deductionL = new javax.swing.JLabel();
        finalScoreL = new javax.swing.JLabel();
        scoreBL = new javax.swing.JLabel();
        groupGenderL = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        mistakeT = new javax.swing.JTextArea();
        scoreCL = new javax.swing.JLabel();
        scoreAL = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        jPanel2.setLayout(new java.awt.GridBagLayout());

        jPanel2.setBackground(new java.awt.Color(51, 153, 0));
        jPanel2.setMinimumSize(new java.awt.Dimension(800, 600));
        jPanel2.setPreferredSize(new java.awt.Dimension(820, 620));
        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setMinimumSize(new java.awt.Dimension(780, 580));
        jPanel1.setPreferredSize(new java.awt.Dimension(800, 600));
        nameL.setFont(new java.awt.Font("Bitstream Vera Sans", 0, 70));
        nameL.setForeground(new java.awt.Color(51, 51, 255));
        nameL.setText("name");
        jPanel1.add(nameL, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 80, -1, 90));

        mistakeL.setFont(new java.awt.Font("Bitstream Vera Serif", 0, 36));
        mistakeL.setText("mistake");
        mistakeL.setMaximumSize(new java.awt.Dimension(800, 47));
        jPanel1.add(mistakeL, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 220, -1, -1));

        eventL.setFont(new java.awt.Font("Copperplate Gothic Bold", 0, 36));
        eventL.setText("event");
        jPanel1.add(eventL, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 40, -1, -1));

        deductionL.setFont(new java.awt.Font("Bitstream Vera Serif", 0, 36));
        deductionL.setText("deduction");
        jPanel1.add(deductionL, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 450, -1, -1));

        finalScoreL.setFont(new java.awt.Font("Verdana", 0, 64));
        finalScoreL.setForeground(new java.awt.Color(0, 0, 204));
        finalScoreL.setText("final");
        jPanel1.add(finalScoreL, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 500, -1, -1));

        scoreBL.setFont(new java.awt.Font("Bitstream Vera Serif", 0, 36));
        scoreBL.setText("score B");
        jPanel1.add(scoreBL, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 350, -1, -1));

        groupGenderL.setFont(new java.awt.Font("Copperplate Gothic Bold", 0, 36));
        groupGenderL.setText("event");
        jPanel1.add(groupGenderL, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 0, -1, -1));

        mistakeT.setEditable(false);
        mistakeT.setFont(new java.awt.Font("Courier", 1, 24));
        mistakeT.setLineWrap(true);
        mistakeT.setWrapStyleWord(true);
        jScrollPane1.setViewportView(mistakeT);

        jPanel1.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 170, 580, 130));

        scoreCL.setFont(new java.awt.Font("Bitstream Vera Serif", 0, 36));
        scoreCL.setText("score C");
        jPanel1.add(scoreCL, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 400, -1, -1));

        scoreAL.setFont(new java.awt.Font("Bitstream Vera Serif", 0, 36));
        scoreAL.setText("score A");
        jPanel1.add(scoreAL, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 310, -1, -1));

        jPanel2.add(jPanel1, new java.awt.GridBagConstraints());

        getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);

        pack();
    }
    // </editor-fold>//GEN-END:initComponents
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Summary(new javax.swing.JFrame(), true).setVisible(true);
            }
        });
    }
     
    // clear text
    public void clear()
    {
        groupGenderL.setText("");
        eventL.setText("");
        nameL.setText("");
        mistakeL.setText("");
        scoreAL.setText("");
        scoreBL.setText("");
        scoreCL.setText("");
        deductionL.setText("");
        finalScoreL.setText("");
        mistakeT.setText("");
    }
    
    // set group and gender
    public void setGroupGender(String data)
    {
        groupGenderL.setText(data);
    }
    
    //set events
    public void setEvent(String data)
    {
        eventL.setText(data);        
    }
    
    //set name
    public void setName(String data)
    {
        nameL.setText(data);
    }
    
    //set mistakes
    public void setMistake(String data)
    {
        //bad hack to show scores from al judges
        
        if(globalData.scoringSystemType==0)// 0 traditional, 1 nandu, 2 compulsory
        {
            mistakeL.setText("Scores");
            mistakeT.setText(data);
        }
        if(globalData.scoringSystemType==1)// 0 traditional, 1 nandu, 2 compulsory
        {
            mistakeL.setText("Scores");
            mistakeT.setText(data);
        }
        else
        {
            mistakeL.setText("Summary");
            mistakeT.setText(data);
        }
    }
    
    //set Score
    public void setScoreA(String data)
    {
        scoreAL.setText("Judge A Score \t: "+data+"/5.00");
    }
    
    //set Score
    public void setScoreB(String data)
    {
        if(globalData.scoringSystemType==0)// 0 traditional, 1 nandu, 2 compulsory
        {
            scoreBL.setText("Avg. Score \t: "+data+"/10.00");
        }
        if(globalData.scoringSystemType==1)// 0 traditional, 1 nandu, 2 compulsory
        {
            scoreBL.setText("Avg. Score \t: "+data+"/3.00");
        }
        else
        {
            scoreBL.setText("Judge B Score \t: "+data+"/5.00");
        }
     }
    
    public void setScoreC(String data)
    {
        scoreCL.setText("Judge C Score \t: "+data+"/2.00");
    }
    
    //set deduction
    public void setDeduction(String data, String reason)
    {
        String reasonString = "";
        if (reason != null && reason.length() > 0 && !reason.equals("null")) {
            reasonString = "(" + reason + ")";
        }
        deductionL.setText("Deduction\t: "+data + " " + reasonString);;        
    }
    
    //set total
    public void setFinalScore(String data)
    {
        finalScoreL.setText("Final Score \t: "+data);
    }
    
    
 
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel deductionL;
    private javax.swing.JLabel eventL;
    private javax.swing.JLabel finalScoreL;
    private javax.swing.JLabel groupGenderL;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel mistakeL;
    private javax.swing.JTextArea mistakeT;
    private javax.swing.JLabel nameL;
    private javax.swing.JLabel scoreAL;
    private javax.swing.JLabel scoreBL;
    private javax.swing.JLabel scoreCL;
    // End of variables declaration//GEN-END:variables
    
}
